﻿#include "stdafx.h"
#if _QG_ENABLE_WIDGET
#include "qg/qgasv.h"
#include "qg/qgmtrl.h"
#include "qg/qgrdraw.h"
#include "qg/qgwidget.h"

//////////////////////////////////////////////////////////////////////////
// 라벨
KIMPL_SUBCLASS(qwLabel, "WidgetLabel");

qwLabel::qwLabel(qgWidgetType type, kint instmask)
: super_type(type, instmask)
{
}

bool qwLabel::OnUpdate(float adv)
{
	BuildBound();

	if (NeedRefresh())
	{
		BuildTextAnch();

		ResetRefresh();
	}

	return true;
}

void qwLabel::OnDraw()
{
	if (CanFill())
		_shed->DrawFillRect(_client, GetResource(), _tex);

	if (HasBorder())
		_shed->DrawEmptyRect(_client, _color_border);

	if (HasText())
		_shed->DrawAnchText(_font, _textstr.Data(), _client, _textinfo, 0);

	qwControl::OnDraw();
}

#endif
